<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>数组的sort方法</title>
	</head>
	<body>
		<script type="text/javascript">
			var a=['banana','apple','mango']
			//a.reverse()颠倒顺序
			a.reverse();
			console.log(a);
			a.sort();
			console.log(a);
			var b=[3,23,44,32,56]
			b.sort(function(c,d){
				//返回的是c-f 升序，返回f-c降序
				return f-c;
			}
		);
			console.log(b);
		</script>
	</body>
</html>
